#!/bin/bash


port=3306
echo  'default port:' $port
if  [ -n "$1" ] ;then
   port=$2
   echo 'port changed to' $2
fi
echo 'use port => '$port

sudo docker stop mysql56_$port
sudo docker rm mysql56_$port




sudo docker run -itd --restart=always  --name=mysql56_$port -p $port:3306 -e MYSQL_DATABASE=dev -e MYSQL_USER=dev -e MYSQL_PASSWORD=a123456 -e MYSQL_ROOT_PASSWORD=a123456 -v /var/msyql$port/mysql:/var/lib/mysql  mysql:5.6




